package com.sq.partner.manager.dao;

import java.util.List;

import com.sq.partner.manager.mybatis.model.DeptDto;
import com.sq.partner.manager.mybatis.model.GatewayRole;
import com.sq.partner.manager.mybatis.model.GatewayRoleDept;

/**
 * 角色权限机构 接口
 * @author zhihuizhao
 *
 */
public interface IGatewayRoleDeptDao {

	/**
	 * 根据当前登录用户id，获取其所有所属权限机构
	 * @param userid
	 * @return
	 * @throws Exception
	 */
	List<DeptDto> queryDeptDto(Long userid) throws Exception;

	/**
	 * 根据某个角色id，获取其所有权限机构
	 * @param roleId
	 * @return
	 * @throws Exception
	 */
	List<DeptDto> queryDeptDtoByRoleId(Long roleId) throws Exception;

	/**
	 * 给某角色配置权限机构
	 * @param role
	 * @return
	 * @throws Exception
	 */
	boolean addDeptsToOneRole(GatewayRoleDept roleDept) throws Exception;


	/**
	 * 给某角色配置权限机构
	 * @param role
	 * @return
	 * @throws Exception
	 */
	boolean delDeptsToOneRole(Long roleid) throws Exception;
	
	boolean updateRoleDeptInfo(GatewayRoleDept roleDept) throws Exception;

}
